package jdklearn.重复注解;

import java.lang.reflect.Method;

/**
 * @author Veng Su 1344114844@qq.com
 * @date 2018/7/13 13:14
 */
public class Test {
    @org.junit.Test
    public void test() throws NoSuchMethodException {
        Class<Test> testClass=Test.class;
        Method method=testClass.getMethod("show");
        MyAnnotation[] myAnnotations=method.getAnnotationsByType(MyAnnotation.class);
        for (MyAnnotation myAnnotation : myAnnotations) {
            System.out.println(myAnnotation.value());
        }
    }
    @MyAnnotation("Veng Su")
    @MyAnnotation("苏文广")
    public void show( @MyAnnotation("su") int a){

    }
}
